package cn.cas.mango.controller;

import cn.cas.mango.dto.Message;
import cn.cas.mango.dto.param.hot.HotMissionParam;
import cn.cas.mango.dto.param.hot.HotSpotParam;
import cn.cas.mango.service.HotSpotSearchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * todo
 * 关于热点的接口
 */
@Controller
@RequestMapping("/EventExtract/assemble/")
@ResponseBody
@CrossOrigin
public class HotSpotSearch {
  @Autowired
  private HotSpotSearchService hotSpotSearchService;

  // 聚簇检索
  @RequestMapping(value = "getAssembleResult",method = {RequestMethod.GET})
  public Message getAssembleResult(HotSpotParam hotSpotParam) throws Exception {
    return hotSpotSearchService.getAssembleResult(hotSpotParam);
  }

  @RequestMapping(value = "getAssembleResult",method = {RequestMethod.POST})
  public Message getAssembleResultPost( HotSpotParam hotSpotParam) throws Exception {
    return hotSpotSearchService.getAssembleResult(hotSpotParam);
  }

  @RequestMapping(value = "statisticsView",method = {RequestMethod.GET})
  public Message getStatisticsView(HotMissionParam param) {
    return hotSpotSearchService.getStatisticsView(param);
  }

  @RequestMapping(value = "statisticsView",method = {RequestMethod.POST})
  public Message getStatisticsViewPost(HotMissionParam param) {
    return hotSpotSearchService.getStatisticsView(param);
  }

  @RequestMapping(value = "addHotsToCrowd",method = {RequestMethod.GET})
  public Message getAddHotsToCrowd( HotMissionParam hotSpotParam) throws Exception {
    return hotSpotSearchService.addHotsToCrowd(hotSpotParam);
  }

  @RequestMapping(value = "addHotsToCrowd",method = {RequestMethod.POST})
  public Message getAddHotsToCrowdPost( HotMissionParam hotSpotParam) throws Exception {
    return hotSpotSearchService.addHotsToCrowd(hotSpotParam);
  }

}
